<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>robotide.context.configobj.ConfigObj</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="robotide-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/robotframework-ride">RIDE</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="robotide-module.html">Package&nbsp;robotide</a> ::
        <a href="robotide.context-module.html">Package&nbsp;context</a> ::
        <a href="robotide.context.configobj-module.html">Module&nbsp;configobj</a> ::
        Class&nbsp;ConfigObj
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class ConfigObj</h1><p class="nomargin-top"><span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+        
         |        
      dict --+    
             |    
       Section --+
                 |
                <strong class="uidshort">ConfigObj</strong>
</pre>

<hr />
An object to read, create, and write config files.

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><pre class="literalblock">
new empty dictionary

</pre></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="robotide.context.configobj.ConfigObj-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">infile</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">options</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">_inspec</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span><br />
      Parse a config file or create a config file object.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="robotide.context.configobj.ConfigObj-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br />
      str(x)</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.__repr__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="robotide.context.configobj.ConfigObj-class.html#write" class="summary-sig-name">write</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">outfile</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">section</span>=<span class="summary-sig-default">None</span>)</span><br />
      Write the current ConfigObj as a file</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.write">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="robotide.context.configobj.ConfigObj-class.html#validate" class="summary-sig-name">validate</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">validator</span>,
        <span class="summary-sig-arg">preserve_errors</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">copy</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">section</span>=<span class="summary-sig-default">None</span>)</span><br />
      Test the ConfigObj against a configspec.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.validate">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="robotide.context.configobj.ConfigObj-class.html#reset" class="summary-sig-name">reset</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Clear ConfigObj instance and restore to 'freshly created' state.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.reset">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="robotide.context.configobj.ConfigObj-class.html#reload" class="summary-sig-name">reload</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Reload a ConfigObj from file.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.reload">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>Section</code></b>:
      <code>__delitem__</code>,
      <code>__getitem__</code>,
      <code>__iter__</code>,
      <code>__reduce__</code>,
      <code>__setitem__</code>,
      <code>__setstate__</code>,
      <code>__str__</code>,
      <code>as_bool</code>,
      <code>as_float</code>,
      <code>as_int</code>,
      <code>as_list</code>,
      <code>clear</code>,
      <code>dict</code>,
      <code>get</code>,
      <code>items</code>,
      <code>iteritems</code>,
      <code>iterkeys</code>,
      <code>itervalues</code>,
      <code>keys</code>,
      <code>merge</code>,
      <code>pop</code>,
      <code>popitem</code>,
      <code>rename</code>,
      <code>restore_default</code>,
      <code>restore_defaults</code>,
      <code>setdefault</code>,
      <code>update</code>,
      <code>values</code>,
      <code>walk</code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>dict</code></b>:
      <code>__cmp__</code>,
      <code>__contains__</code>,
      <code>__eq__</code>,
      <code>__ge__</code>,
      <code>__getattribute__</code>,
      <code>__gt__</code>,
      <code>__le__</code>,
      <code>__len__</code>,
      <code>__lt__</code>,
      <code>__ne__</code>,
      <code>__new__</code>,
      <code>__sizeof__</code>,
      <code>copy</code>,
      <code>fromkeys</code>,
      <code>has_key</code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Class Variables</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>dict</code></b>:
      <code>__hash__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">infile</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">options</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">_inspec</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">**kwargs</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Parse a config file or create a config file object.</p>
<p><tt class="rst-docutils literal">ConfigObj(infile=None, options=None, **kwargs)</tt></p>
  <dl class="fields">
    <dt>Returns: <pre class="literalblock">
new empty dictionary

</pre></dt>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="__repr__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">self</span>)</span>
    <br /><em class="fname">(Representation operator)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.__repr__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  str(x)
  <dl class="fields">
    <dt>Overrides:
        object.__repr__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="write"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">write</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">outfile</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">section</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.write">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Write the current ConfigObj as a file</p>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>filename = a.filename
<span class="py-prompt">&gt;&gt;&gt; </span>a.filename = <span class="py-string">'test.ini'</span>
<span class="py-prompt">&gt;&gt;&gt; </span>a.write()
<span class="py-prompt">&gt;&gt;&gt; </span>a.filename = filename
<span class="py-prompt">&gt;&gt;&gt; </span>a == ConfigObj(<span class="py-string">'test.ini'</span>, raise_errors=True)
<span class="py-output">1</span></pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="validate"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">validate</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">validator</span>,
        <span class="sig-arg">preserve_errors</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">copy</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">section</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.validate">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Test the ConfigObj against a configspec.</p>
<p>It uses the <tt class="rst-docutils literal">validator</tt> object from <em>validate.py</em>.</p>
<p>To run <tt class="rst-docutils literal">validate</tt> on the current ConfigObj, call:</p>
<pre class="rst-literal-block">
test = config.validate(validator)
</pre>
<p>(Normally having previously passed in the configspec when the ConfigObj
was created - you can dynamically assign a dictionary of checks to the
<tt class="rst-docutils literal">configspec</tt> attribute of a section though).</p>
<p>It returns <tt class="rst-docutils literal">True</tt> if everything passes, or a dictionary of
pass/fails (True/False). If every member of a subsection passes, it
will just have the value <tt class="rst-docutils literal">True</tt>. (It also returns <tt class="rst-docutils literal">False</tt> if all
members fail).</p>
<p>In addition, it converts the values from strings to their native
types if their checks pass (and <tt class="rst-docutils literal">stringify</tt> is set).</p>
<p>If <tt class="rst-docutils literal">preserve_errors</tt> is <tt class="rst-docutils literal">True</tt> (<tt class="rst-docutils literal">False</tt> is default) then instead
of a marking a fail with a <tt class="rst-docutils literal">False</tt>, it will preserve the actual
exception object. This can contain info about the reason for failure.
For example the <tt class="rst-docutils literal">VdtValueTooSmallError</tt> indicates that the value
supplied was too small. If a value (or section) is missing it will
still be marked as <tt class="rst-docutils literal">False</tt>.</p>
<p>You must have the validate module to use <tt class="rst-docutils literal">preserve_errors=True</tt>.</p>
<p>You can then use the <tt class="rst-docutils literal">flatten_errors</tt> function to turn your nested
results dictionary into a flattened list of failures - useful for
displaying meaningful error messages.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="reset"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">reset</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.reset">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  Clear ConfigObj instance and restore to 'freshly created' state.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="reload"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">reload</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="robotide.context.configobj-pysrc.html#ConfigObj.reload">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Reload a ConfigObj from file.</p>
<p>This method raises a <tt class="rst-docutils literal">ReloadError</tt> if the ConfigObj doesn't have
a filename attribute pointing to a file.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="robotide-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/robotframework-ride">RIDE</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Wed Apr 13 15:09:37 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
